﻿








namespace UFIDA.U9.Cust.U9Demo.DeliveryBP.Proxy
{
	using System;
	using System.Collections.Generic;
	using System.Text;
	using System.IO;
	using System.ServiceModel;
	using System.Runtime.Serialization;
	using UFSoft.UBF;
	using UFSoft.UBF.Exceptions;
	using UFSoft.UBF.Util.Context;
	using UFSoft.UBF.Service;
	using UFSoft.UBF.Service.Base ;

    [System.ServiceModel.ServiceContractAttribute(Namespace = "http://www.UFIDA.org", Name="UFIDA.U9.Cust.U9Demo.DeliveryBP.IStatusUpdate")]
    public interface IStatusUpdate
    {
		[ServiceKnownType(typeof(ApplicationContext))]
		[ServiceKnownType(typeof(PlatformContext))]
		[ServiceKnownType(typeof(ThreadContext))]
		[ServiceKnownType(typeof( UFSoft.UBF.Business.BusinessException))]
		[ServiceKnownType(typeof( UFSoft.UBF.Business.EntityNotExistException))]
		[ServiceKnownType(typeof( UFSoft.UBF.Business.AttributeInValidException))]
		[ServiceKnownType(typeof(UFSoft.UBF.Business.AttrsContainerException))]
		[ServiceKnownType(typeof(UFSoft.UBF.Exceptions.MessageBase))]
			[FaultContract(typeof(UFSoft.UBF.Service.ServiceLostException))]
		[FaultContract(typeof(UFSoft.UBF.Service.ServiceException))]
		[FaultContract(typeof(UFSoft.UBF.Service.ServiceExceptionDetail))]
		[FaultContract(typeof(ExceptionBase))]
		[FaultContract(typeof(Exception))]
		[OperationContract()]
		System.Boolean Do(IContext context, out IList<MessageBase> outMessages ,System.Int64 iD, UFSoft.UBF.Business.BusinessEntity.EntityKey doc, System.Int64 version, System.Int32 type);
    }
	[Serializable]    
    public class StatusUpdateProxy : OperationProxyBase//, UFIDA.U9.Cust.U9Demo.DeliveryBP.Proxy.IStatusUpdate
    {
	#region Fields	
				private System.Int64 iD ;
				
		private UFSoft.UBF.Business.BusinessEntity.EntityKey m_Doc_SKey ;
						private System.Int64 version ;
						private System.Int32 type ;
			
	#endregion	
		
	#region Properties
	
				

		/// <summary>
		/// 送货单ID (该属性可为空,但有默认值)
		/// 单据状态改变.Misc.送货单ID
		/// </summary>
		/// <value>System.Int64</value>
		public System.Int64 ID
		{
			get	
			{	
				return this.iD;
			}

			set	
			{	
				this.iD = value;	
			}
		}		
				
		/// <summary>
		/// 送货单 序列化Key属性。（传递跨组织序列列字段）
		/// 单据状态改变.Misc.送货单
		/// </summary>
		public UFSoft.UBF.Business.BusinessEntity.EntityKey Doc_SKey
		{
			get 
			{
				return m_Doc_SKey ;					
			}
			set
			{
				m_Doc_SKey = value ;
			}
		}


		/// <summary>
		/// 送货单 (该属性可为空,且无默认值)
		/// 单据状态改变.Misc.送货单
		/// </summary>
		/// <value>UFIDA.U9.Cust.U9Demo.DeliverBE.Delivery</value>
		public Int64 Doc
		{
			get	
			{	
				if (Doc_SKey == null)
					return UFSoft.UBF.Business.Entity.EmptyObjectValue ;
				else
					return Doc_SKey.ID ;
			}
			set	
			{	
				if (value == 0 || value == UFSoft.UBF.Business.Entity.EmptyObjectValue )
					Doc_SKey = null ;
				else
				{
					if (Doc_SKey == null )
						Doc_SKey = new UFSoft.UBF.Business.BusinessEntity.EntityKey(value,"UFIDA.U9.Cust.U9Demo.DeliverBE.Delivery") ;
					else
						Doc_SKey.ID = value ;
				}
			}
		}
						

		/// <summary>
		/// 版本号 (该属性可为空,但有默认值)
		/// 单据状态改变.Misc.版本号
		/// </summary>
		/// <value>System.Int64</value>
		public System.Int64 Version
		{
			get	
			{	
				return this.version;
			}

			set	
			{	
				this.version = value;	
			}
		}		
						

		/// <summary>
		/// 类型区分 (该属性可为空,但有默认值)
		/// 单据状态改变.Misc.类型区分
		/// </summary>
		/// <value>System.Int32</value>
		public System.Int32 Type
		{
			get	
			{	
				return this.type;
			}

			set	
			{	
				this.type = value;	
			}
		}		
			
	#endregion	


	#region Constructors
        public StatusUpdateProxy()
        {
        }
        #endregion
        

		#region Public Method
		
        public System.Boolean Do()
        {
  			InitKeyList() ;
 			System.Boolean result = (System.Boolean)InvokeAgent<UFIDA.U9.Cust.U9Demo.DeliveryBP.Proxy.IStatusUpdate>();
			return GetRealResult(result);
        }
        
		protected override object InvokeImplement<T>(T oChannel)
        {
			IContext context = ContextManager.Context;			

            IStatusUpdate channel = oChannel as IStatusUpdate;
            if (channel != null)
            {
				return channel.Do(context, out returnMsgs, iD, Doc_SKey, version, type);
	    }
            return  false;
        }
		#endregion
		
		//处理由于序列化导致的返回值接口变化，而进行返回值的实际类型转换处理．
		private System.Boolean GetRealResult(System.Boolean result)
		{

				return result ;
		}
		#region  Init KeyList 
		//初始化SKey集合--由于接口不一样.BP.SV都要处理
		private void InitKeyList()
		{
			System.Collections.Hashtable dict = new System.Collections.Hashtable() ;
																				
		}
		#endregion 

    }
}



